<?php

function downfiles($field, $value) {
    $files = $_POST[$field . '_fileurl'];
    $files_alt = $_POST[$field . '_filename'];
    $array = $temp = array();
    if (!empty($files)) {
        foreach ($files as $key => $file) {
            $temp['fileurl'] = $file;
            $temp['filename'] = $files_alt[$key];
            $array[$key] = $temp;
        }
    }
    $array = serialize($array);
    return $array;
}

?>